from flask import Flask, send_file, make_response, render_template
import sys

app = Flask(__name__)



@app.route("/markdownlang/",methods=["post,get,put,options,delete"])
def getMarkdownLang():
    resp = make_response(render_template('result.html'))
    resp.headers['Access-Control-Allow-Origin'] = '*'
    return resp



@app.route('/index')
def index():
    # 用户首页
    return send_file('templates/index.html')

@app.route('/login')
def login():
    # 用户登录
    return send_file('templates/login.html')


@app.route('/welcome')
def welcome():
    # 主页
    return send_file('templates/welcome.html')


@app.route('/commodity-list')
def commodity_list():
    # 商品列表
    return send_file('templates/commodity-list.html')


@app.route('/commodity-add')
def commodity_add():
    # 商品添加
    return send_file('templates/commodity-add.html')


@app.route('/commodity-edit')
def commodity_edit():
    # 商品编辑
    return send_file('templates/commodity-edit.html')


@app.route('/commodity-del')
def commodity_del():
    # 商品删除
    return send_file('templates/commodity-del.html')


@app.route('/admin-list')
def admin_list():
    # 管理员列表
    return send_file('templates/admin-list.html')


@app.route('/admin-add')
def admin_add():
    # 管理员添加
    return send_file('templates/admin-add.html')


@app.route('/admin-edit')
def admin_edit():
    # 管理员编辑
    return send_file('templates/admin-edit.html')


@app.route('/member-list')
def member_list():
    # 用户列表
    
    return send_file('templates/member-list.html')

@app.route('/member-add')
def member_add():
    # 新增用户
    return send_file('templates/member-add.html')

@app.route('/member-edit')
def member_edit():
    # 编辑用户
    return send_file('templates/member-edit.html')

@app.route('/order-list')
def order_list():
    # 订单列表
    return send_file('templates/order-list.html')

@app.route('/order-add')
def order_add():
    # 添加订单
    return send_file('templates/order-add.html')

@app.route('/order-edit')
def order_edit():
    # 编辑订单
    return send_file('templates/order-edit.html')







@app.route('/user/data')
def data():
    # 向用户表插入数据
    return send_file('templates/insertData.html')


@app.route('/commodity/<username>')
def commodity(username):
    # 商品管理首页
    return send_file('templates/commodity-list.html')

@app.route('/order/<username>')
def order(username):
    # 订单管理首页
    return send_file('templates/order-list.html')

@app.route('/member/<username>')
def member(username):
    # 用户管理首页
    return send_file('templates/member-list.html')

@app.route('/admin/<username>')
def admin(username):
    # 订单管理首页
    return send_file('templates/admin-list.html')




@app.route('/topicDetail/<t_id>')
def topicDetail(t_id):
    # 游戏库
    return send_file('templates/topicDetail.html')


if __name__ == '__main__':
    app.run(debug=True)
